<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>互动</title>


		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />-->
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="./css/font.css">
		<link rel="stylesheet" href="./css/xadmin.css">
		<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="./js/xadmin.js"></script>


		<link href="client/css/mui.min.css" rel="stylesheet" />
		<link href="client/css/build.css" rel="stylesheet" type="text/css" />
		<script src="client/js/mui.min.js"></script>
	</head>
	<body>
	<center>
<h1>修改密码</h1>

	<h2 style="color: red" th:if="${msg!=null}" th:text="${msg}"></h2>

	<form class="layui-form" id="myform" method="post" action="/addcontent">
		<div class="layui-form-item">
			<label for="oldpwd" class="layui-form-label">
				<span class="x-red">*</span>原密码
			</label>
			<div class="layui-input-inline">
				<input type="password" id="oldpwd" name="oldpwd" required="" lay-verify="required"
					   autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label for="newpwd" class="layui-form-label">
				<span class="x-red">*</span>现密码
			</label>
			<div class="layui-input-inline">
				<input type="password" id="newpwd" name="newpwd" required="" lay-verify="required"
					   autocomplete="off" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label for="pwdnew" class="layui-form-label">
				<span class="x-red">*</span>现密码
			</label>
			<div class="layui-input-inline">
				<input type="password" id="pwdnew" name="pwdnew" required="" lay-verify="required"
					   autocomplete="off" class="layui-input">
			</div>
		</div>


		<div class="layui-form-item">
			<label class="layui-form-label">
			</label>
			<button type="button" id="butn"  class="layui-btn">提交</button>
		</div>
	</form>
<!-- 底部信息-->
<div class="footer_box">
	<div class="footer_txt">
		<p>版权所有：中国民用航空局</p>
		<p>ICP备案编号：京ICP备19046468号</p>
	</div>
</div>

			<!-- 底部tabbar    start -->
			<nav class="mui-bar mui-bar-tab tabbar-bottom">
				<a class="mui-tab-item" onclick="window.location.href='/selectAllLaws'">
					<span class="mui-icon"><img src="client/images/nav_home.png" /></span>
					<span class="mui-tab-label">首页</span>
				</a>
				<a class="mui-tab-item" onclick="window.location.href='/hudongAdd'">
					<span class="mui-icon"><img src="client/images/nav_hudong.png" /></span>
					<span class="mui-tab-label">咨询</span>
				</a>
				<a class="mui-tab-item mui-active" onclick="window.location.href='/user.html'">
					<span class="mui-icon"><img src="client/images/nav_user_on.png" /></span>
					<span class="mui-tab-label">我的</span>
				</a>
			</nav>
			<!-- 底部tabbar    end -->
			<script type="text/javascript">
				mui.init();

			</script>
	</center>
	</body>
	<script>

		layui.use(['form','layer'], function(){
			$ = layui.jquery;
			var form = layui.form
					,layer = layui.layer;

			//自定义验证规则
			form.verify({
				nikename: function(value){
					if(value.length < 5){
						return '昵称至少得5个字符啊';
						``     }
				}
				,pass: [/(.+){6,12}$/, '密码必须6到12位']
				,repass: function(value){
					if($('#L_pass').val()!=$('#L_repass').val()){
						return '两次密码不一致';
					}
				}
			});

			//监听提交
			form.on('submit(add)', function(data){
				console.log(data);
				//发异步，把数据提交给php
				var myform = document.getElementById("myform");
				myform.submit();
				layer.alert("增加成功", {icon: 6},function () {
					// 获得frame索引
					var index = parent.layer.getFrameIndex(window.name);
					//关闭当前frame
					parent.layer.close(index);
				});
				return false;
			});
		});

		$(function () {
			$("#butn").click(function () {

				let val = $("#newpwd").val();
				let val1 = $("#pwdnew").val();

				if (val != val1){
					alert("两次密码不一致")
					return false;
				}
				var myfor = $("#myform");
				let jQuery = myfor.serialize();
				// alert(jQuery);
				location="/updateClitpwd?"+jQuery;
			});
		});
	</script>
<!--	<script>var _hmt = _hmt || []; (function() {-->
<!--		var hm = document.createElement("script");-->
<!--		hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";-->
<!--		var s = document.getElementsByTagName("script")[0];-->
<!--		s.parentNode.insertBefore(hm, s);-->
<!--	})();</script>-->
</html>
